# -*- mode: snippet -*-
# name: ms-report
# key: msr
# contributor: John Kitchin <jkitchin@andrew.cmu.edu>
# --
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [12pt]
#+OPTIONS: toc:nil ^:{}
#+EXPORT_EXCLUDE_TAGS: noexport
#+VERSION: 0.1.0
#+EXPORT_FILE_NAME: `kitchingroup-github-id`-ms-final-report.pdf
#+FILETAGS: ms report `(if (boundp 'kitchingroup-github-id) kitchingroup-github-id "NOGITHUBID")`
# here is where you include the relevant packages. These are pretty
# common ones. You may add additional ones. Note that the order of the
# packages is significant. If you are not careful, your file will not
# build into a pdf.
#+LATEX_HEADER: \usepackage[top=1in, bottom=1.in, left=1in, right=1in]{geometry}
#+LATEX_HEADER: \usepackage[utf8]{inputenc}
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{fixltx2e}
#+LATEX_HEADER: \usepackage{natbib}
#+LATEX_HEADER: \usepackage{url}
#+LATEX_HEADER: \usepackage{minted}  % for source code
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{textcomp}
#+LATEX_HEADER: \usepackage{amsmath}
#+LATEX_HEADER: \usepackage{pdfpages}
#+LATEX_HEADER: \usepackage[version=3]{mhchem}
#+LATEX_HEADER: \usepackage{setspace}
#+LATEX_HEADER: \usepackage[linktocpage, pdfstartview=FitH, colorlinks, linkcolor=blue, anchorcolor=blue, citecolor=blue,  filecolor=blue,  menucolor=blue,  urlcolor=blue]{hyperref}


#+BEGIN_LaTeX
\doublespace
\thispagestyle{empty}
\begin{titlepage}

    \begin{center}
        \vspace*{1cm}
        \LARGE
        \textbf{${1:title}}

        \vspace{2.5cm}
        \large
        \textbf{${2:full name}}

        \vfill

        Submitted in partial fulfillment of the requirements for the degree of\\
        Master of Science

        \vspace{0.8cm}

        Department of Chemical Engineering\\
        Carnegie Mellon University\\
        Pittsburgh, PA, USA\\
        \today

    \end{center}
\end{titlepage}


\thispagestyle{empty}

\raggedbottom

% scan your signature page and name it signature.pdf, then uncomment this line.
% \includepdf[pages=1]{signature.pdf}

\newpage

\tableofcontents
\newpage

\section*{Abstract}
\onehalfspacing \large
${3:abstract}

\newline
Keywords: ${4:keywords}.

\newpage


\newpage
\doublespacing
\listoffigures
\newpage

\onehalfspacing
\large

\newpage
\clearpage
\setcounter{page}{1}
#+END_LaTeX


* Introduction
# Use citation links. Always put punctuation to the right in org-mode. natbib will sort it out in the export correctly.
$0
* Methods
# Describe the relevant methods for your work here.

* Results and Discussion
# Here is where the results and discussion go.

* Conclusions
# Summarize the main conclusions here.

\newpage
bibliographystyle:unsrt
bibliography:${5:bibfile}

* build								   :noexport:

[[elisp:(org-open-file (org-latex-export-to-pdf))]]


- [ ] [[elisp:org-ref]]  run this to check for errors
- [ ] Did you put in keywords?

** Submit

Run this code block to commit and submit your report. Note that this will add everything in this directory, so do not do this if you have a lot of files

#+BEGIN_SRC sh
# 10 MB max report size
MAXSIZE="10485760"
CHECK="\`du -s . | awk '{print \$1}'\`"

if [ "$MAXSIZE" -gt "$CHECK" ]; then
    git add *
    git commit -am "Automated commit"
    git push
else
    echo "This directory is too big. Please see Prof. Kitchin" 1>&2
    exit 1
fi
#+END_SRC

You can also use elisp:magit-status to add, commit and push the files.

a - will add a file
s - will stage a file
cc - will commit a set of changes, enter your message and type C-cC-c
Pp - will push to the remote repo

Either way, don't forget to send Prof. Kitchin an email that you have submitted the report and it is ready for review. Then, wait for feed back from him for you to review. You should try to not modify the repo until then to keep things simple.

Then run this block to pull the changes back for you to review.

#+BEGIN_SRC emacs-lisp
(shell-command "git pull")
(revert-buffer)
(goto-char (point-min))
#+END_SRC

If you run into any problems, please see Prof. Kitchin.

*************** TODO Review annual report for `kitchingroup-github-id` :jkitchin:
Do not remove this. It is here so this shows up in my agenda as an item to do.
*************** END
